<#import "/common/taglibs/spring.ftl" as spring/>
<#if source??>
    <#global m=source>  
</#if>
<#if parent??>
    <#global m=parent>  
</#if>
<ul class="nav nav-tabs m-tabs-line m-tabs-line--success m-tabs-line--2x" role="tablist">
<#if m.id??>
    <#global id=m.id>
    <li class="nav-item m-tabs__item">
        <a class="nav-link m-tabs__link ${(op == 'op.view')?string('active','')}" href="${ctx}/${baseUrl!}/${id}">
            <i class="la la-eye"></i>
            <@spring.message code="op.view"/>
        </a>
    </li>

    <@security.authorize access="hasAuthority('${resourceIdentity!}:update')">
        <li class="nav-item m-tabs__item">
        <a class="nav-link m-tabs__link ${(op == 'op.edit')?string('active','')}" href="${ctx}/${baseUrl!}/${id}/update">
            <i class="la la-edit"></i>
            <@spring.message code="op.edit"/>
        </a>
        </li>
    </@security.authorize>

    <#if !m.root>
        <@security.authorize access="hasAuthority('${resourceIdentity!}:delete')">
            <li class="nav-item m-tabs__item">
            <a class="nav-link m-tabs__link ${(op == 'op.delete')?string('active','')}" href="${ctx}/${baseUrl!}/${id}/delete">
                <i class="la la-trash"></i>
                <@spring.message code="op.delete"/>
            </a>
            </li>
        </@security.authorize>
    </#if>


    <@security.authorize access="hasAuthority('${resourceIdentity!}:create')">
        <li class="nav-item m-tabs__item">
            <a class="nav-link m-tabs__link ${(op == 'op.add.child')?string('active','')}" href="${ctx}/${baseUrl!}/${id}/appendChild">
                <i class="la la-file"></i>
                <@spring.message code="op.add.child"/>
            </a>
        </li>
    </@security.authorize>
    <@security.authorize access="hasAuthority('${resourceIdentity!}:update')">
        <li class="nav-item m-tabs__item">
            <a class="nav-link m-tabs__link ${(op == 'op.move')?string('active','')}" href="${ctx}/${baseUrl!}/${id}/move">
                <i class="la la-arrows"></i>
                <@spring.message code="op.move"/>
            </a>
        </li>
    </@security.authorize>

    <li class="nav-item m-tabs__item dropdown">
        <a href="#" class="nav-link m-tabs__link dropdown-toggle" data-toggle="dropdown"><i class="la la-cog"></i> <@spring.message code="more"/></a>
        <div class="dropdown-menu">
            <#if !(m.leaf!)>
                <a class="dropdown-item ${(op == 'op.view.child')?string('active','')}" href="${ctx}/${baseUrl!}/${id}/children">
                    <i class="la la-list"></i>
                    <@spring.message code="op.view.child"/>
                </a>
            </#if>
            <#if !(m.root!)>
                <a class="dropdown-item ${(op == 'op.view.parent')?string('active','')}" href="${ctx}/${baseUrl!}/${m.parentId}/update">
                    <i class="la la-mail-reply"></i>
                    <@spring.message code="op.view.parent"/>
                </a>
            </#if>
        </div>
    </li>
</#if>
</ul>
